package com.xzy.generic.bad.example.d;

import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;

/**
 * {@link XxxEvent} 事件处理器
 *
 * @author xzy.xiao
 * @date 2023/2/27  9:51
 */
class XxxEventListener implements ApplicationListener<XxxEvent> , Ordered {
    @Override
    public void onApplicationEvent(XxxEvent event) {
        System.out.printf("监听到事件：%s\n", event.toString());
    }

    /**
     * Get the order value of this object.
     * <p>Higher values are interpreted as lower priority. As a consequence,
     * the object with the lowest value has the highest priority (somewhat
     * analogous to Servlet {@code load-on-startup} values).
     * <p>Same order values will result in arbitrary sort positions for the
     * affected objects.
     *
     * @return the order value
     * @see #HIGHEST_PRECEDENCE
     * @see #LOWEST_PRECEDENCE
     */
    @Override
    public int getOrder() {
        return 0;
    }
}
